import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int p = scanner.nextInt();
        for(int i=1;i<p;i++) {
            for(int j=1;j<=i;j++) {
                System.out.print(abc(i)+"*"+abc(j)+"="+jz(i*j, p)+" ");
            }
            System.out.println();
        }
    }

    static String jz(int a,int b) {
        String str = "";
        while(a!=0) {
            str= abc(a%b)+""+str;
            a = a/b;
        }
        return str;
    }

    static char abc(int a) {
        if(a<10) {
            return (char)(a+48);
        }else {
            return (char)(a+65-10);
        }
    }

}